<?php

namespace plugin\admin\app\model;

use plugin\admin\app\model\Base;
use const support\wallet_types_remarks;

/**
 * @property integer $id 钱包ID(主键)
 * @property string $wallet_name 钱包名称
 * @property integer $wallet_type 钱包类型. 1余额
 * @property string $member_id 用户id
 * @property integer $member_type 用户类型
 * @property string $balance 余额
 * @property string $frozen_amount 冻结金额
 * @property string $total_amount 累计金额
 * @property integer $status 是否有效 1有效,2无效 
 * @property integer $create_time 添加时间
 * @property integer $update_time 更新时间
 */
class RlMemberWallet extends Base
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'rl_member_wallets';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';
    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    public function getWalletNameAttribute($value): string
    {
        return wallet_types_remarks[$this->wallet_type]??'';
    }

    public $appends=[
        'wallet_name'
    ];


}
